﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using V = Science.Mathematics.VectorCalculus;

namespace VectorCalculus5Ed.Chapter4.Section2
{
    public class Example01
    {
        public Example01()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
        public void Compute()
        {
            V.Function.ToLastType<double, double[]> f
                = new V.Function.ToLastType<double, double[]>(func);
            V.Path p = new V.Path(f);
            V.ArcLength al = new V.ArcLength(p,0.0,2.0*Math.PI);
            al.Compute();
            result += al.Result.ToString() + "\r\n";
            double res = 4.0 * Math.PI;
            result += res.ToString() + "\r\n";
        }
        private double[] func(double t)
        {
            double[] c = new double[2];
            c[0] = 2.0*Math.Cos(t);
            c[1] = 2.0*Math.Sin(t);
            return c;
        }
    }
}
/*
12.566370614364
12.5663706143592
*/
   